#include "dev_layout.h"



#define LED		HAL_PORT_A,HAL_Pin_5
#define KEY		HAL_PORT_C,HAL_Pin_13



void DeviceInit()
{
	dev_handle.cpu->systemclock();
	//led init
	dev_handle.led->init(LED);
	dev_handle.key->init(KEY);
	dev_handle.uart->init(USART2,115200);
}

int main(){
	uint8_t key_value=0;

	DeviceInit();
	
	
	
	while(1){
		key_value=dev_handle.key->read_sta(KEY);
		if(key_value==0){
			dev_handle.led->high(LED);
			dev_handle.uart->send_str(USART2,"Hello World!\r\n");
		}else{
			dev_handle.led->low(LED);
		}
		dev_handle.cpu->delay_ms(20); 
	}

}
